package com.serviceprovider.business.module.admin.user.services.dao.interfaces;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.role.model.Role;
import com.serviceprovider.business.module.common.Page;
import com.serviceprovider.business.module.user.model.impl.User;
import com.serviceprovider.business.module.user.model.impl.UserSearchCriteria;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;

/**
 * @Leonardo A. Auer
 *
 * @since 04/11/2011
 */

/**
 * This class manages various user operations.
 */
public interface IUserService {
    public Page<User> findAll();

    public Page<User> findAll(int pageNo, int recordSize, String sortColumn, String sortOrder);

    public Page<User> findByRole(Role role);

    public Page findAllLevel1Users();

    public void save(User user);

    public void update(User user);

    public void updateUserActiveFlag(int userId, boolean status);

    public void updateUserActiveFlag(List<Integer> usersId, boolean status);

    public void updateUserInGuiFlag(List<Integer> usersId, boolean status);

    public void remove(int id);

    public void remove(List<Integer> usersId);

    public void unRemove(int id);

    public void unRemove(List<Integer> usersId);

    public User getById(int id);

    public User getByEmail(String email);

    public User getBySSN(int ssn);

    public Page<User> findByIds(List<Integer> userIds, int pageNo, int recordSize, String sortColumn, String sortOrder);

    public List<Long> getAllNonMatchingIds(Integer roleId);

    public Page<User> findUsersByLevel1User(int level1UserId, int pageNo, int recordSize, String sortColumn,
            String sortOrder);

    public Page<User> findUsersByRoleAndLevel1User(int role, int level1UserId, int pageNo, int recordSize,
            String sortColumn, String sortOrder);

    public Page<User> findUserByCriteria(UserSearchCriteria criteria, int pageNo, int recordSize, String sortColumn,
            String sortOrder);

    /**
     * Retrieves from database the corresponding Level1User for the users in the
     * list.
     */
    public void retrieveLevel1User(List<User> userList);

    /**
     * Retrieves from database the corresponding Level1User for the user
     * parameter.
     */
    public void retrieveLevel1User(User user);

    /**
     * Returns the user connected.
     *
     * @return User
     */
    public User getUserConnected();

    public void updateAllUsersActiveFlag(Integer roleId, Boolean isActive);
}



